const { defineConfig } = require('@vue/cli-service')

module.exports = defineConfig({
  devServer: {
    port: 4400,  // 设置开发服务器端口号
    proxy: {
      '/userService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      },
      '/captchaService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      },
      '/courseService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      },
      '/aiService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      },
      '/ordersService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      },
      '/payService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      },
      '/notificationService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      },
      '/searchService': {
        target: 'http://localhost:9999',
        changeOrigin: true
      }
    }
  },
  transpileDependencies: true,  // 用于控制对 node_modules 中的依赖进行转译
  pages: {
    index: {
      entry: 'src/main.js',
      template: 'public/index.html',
      filename: 'index.html',
      title: '稷下书院'
    }
  },
  configureWebpack: {
    performance: {
      hints: false
    }
  },
  chainWebpack: config => {
    config.resolve.alias.set('util', 'util/')
  }
})
